<?php


namespace app\admin\model;


class MwProductLogModel extends BaseModel
{
    protected $name= 'mw_product_log';

    public static function add($mw_id,$pro_id=0,$old_pro_id=''){

        if ($old_pro_id){
            //$arr = ['mw_id'=>$mw_id,'pro_id'=>$pro_id,'add_time'=>time(),'add_user'=>cmf_get_current_admin_id()];
                $arrs = [ 'mw_id'=>$mw_id,'pro_id'=>$old_pro_id,'add_time'=>time(),'add_user'=>cmf_get_current_admin_id()];
//           self::insertGetId($arr);
           self::insertGetId($arrs);
//            exit(json_encode($arr));
        }else{
            $arr = ['mw_id'=>$mw_id,'pro_id'=>$pro_id,'add_time'=>time(),'add_user'=>cmf_get_current_admin_id()];
            self::insert($arr);
        }

    }

}